#include "StdAfx.h"
#include "DD_HubCap.h"

#include "xhHubCap.h"

DD_HubCap::DD_HubCap()
{
	m_pxhHubCap = NULL;
}

DD_HubCap::~DD_HubCap()
{
	MySafeDelete(m_pxhHubCap);
}

#define DKQ_SECT {if( NULL== m_pxhHubCap ) return -1;}

int DD_HubCap::Initialize()
{
	if( NULL == m_pxhHubCap )
	{
		m_pxhHubCap = new xhHubCap;
	}

	DKQ_SECT;
	return m_pxhHubCap->Initialize();
}

int DD_HubCap::UnInitialize()
{
	DKQ_SECT;
	return m_pxhHubCap->UnInitialize();
}

int DD_HubCap::SearchCapture()
{
	DKQ_SECT;
	return m_pxhHubCap->SearchCapture();
}

int DD_HubCap::GetCaptureList(zkCapDevDesc **ppDescs,int &nCount)
{
	DKQ_SECT;
	return m_pxhHubCap->GetCaptureList(ppDescs,nCount);
}
int DD_HubCap::RegOnDrawCallBack(OnDrawCallBackFun funCallBack,void *pContext)
{
	DKQ_SECT;
	return m_pxhHubCap->RegOnDrawCallBack(funCallBack,pContext);
}
int DD_HubCap::RegOnDraw2CallBack(OnDrawCallBackFun funCallBack,void *pContext)
{
	DKQ_SECT;
	return m_pxhHubCap->RegOnDraw2CallBack(funCallBack,pContext);
}
int DD_HubCap::RegCapMsgCallBack(CapMsgCallBackFun funCallBack,void *pContext)
{
	DKQ_SECT;
	return m_pxhHubCap->RegCapMsgCallBack(funCallBack,pContext);
}

int DD_HubCap::SetHwnd(HWND hWnd,zkScreenMon *pScreen)
{
	DKQ_SECT;
	return m_pxhHubCap->SetHwnd(hWnd,pScreen);
}
int DD_HubCap::SetHwnd2(HWND hWnd,zkScreenMon *pScreen)
{
	DKQ_SECT;
	return m_pxhHubCap->SetHwnd2(hWnd,pScreen);
}

int DD_HubCap::SetCacheSize(int nCacheSize)
{
	DKQ_SECT;
	return m_pxhHubCap->SetCacheSize(nCacheSize);
}

int DD_HubCap::SelectCapture(zkCapDevDesc *pDesc)
{
	DKQ_SECT;
	return m_pxhHubCap->SelectCapture(pDesc);
}
// int DD_HubCap::UnLock()
// {
// 	DKQ_SECT;
// 	return m_pxhHubCap->UnLock();
// }


int DD_HubCap::SetPartAH(float fA,float fH)
{
	DKQ_SECT;
	return m_pxhHubCap->SetPartAH(fA,fH);
}
int DD_HubCap::SetPartInfo(void *pVoid)
{
	DKQ_SECT;
	return m_pxhHubCap->SetPartInfo(pVoid);
}
int DD_HubCap::GetPartInfo(void **ppVoid)
{
	DKQ_SECT;
	return m_pxhHubCap->GetPartInfo(ppVoid);
}
int DD_HubCap::GetRemainingTime(int &nRemainTime)
{
	DKQ_SECT;
	return m_pxhHubCap->GetRemainingTime(nRemainTime);
}

int DD_HubCap::GetDispImgSize(int &nWidth,int &nHeight)
{
	DKQ_SECT;
	return m_pxhHubCap->GetDispImgSize(nWidth,nHeight);
}
int DD_HubCap::GetDispImg2Size(int &nWidth,int &nHeight)
{
	DKQ_SECT;
	return m_pxhHubCap->GetDispImg2Size(nWidth,nHeight);
}

int	DD_HubCap::Draw(void *pVoid)
{
	DKQ_SECT;
	return m_pxhHubCap->Draw(pVoid);
}
int	DD_HubCap::Draw2(void *pVoid)
{
	DKQ_SECT;
	return m_pxhHubCap->Draw2(pVoid);
}



int DD_HubCap::OpCapConfig(DWORD dwCmd,void *pVoid,DWORD dwInSize,DWORD *pdwOutSize)
{
	DKQ_SECT;
	return m_pxhHubCap->OpCapConfig(dwCmd,pVoid,dwInSize,pdwOutSize);
}

int DD_HubCap::StartCapture()
{
	DKQ_SECT;
	return m_pxhHubCap->StartCapture();
}

int DD_HubCap::StopCapture()
{
	DKQ_SECT;
	return m_pxhHubCap->StopCapture();
}

int DD_HubCap::GetLiveHistogramInfo(void **ppHistogram)
{
	DKQ_SECT;
	return m_pxhHubCap->GetLiveHistogramInfo(ppHistogram);
}
int DD_HubCap::GetLiveHistogram2Info(void **ppHistogram)
{
	DKQ_SECT;
	return m_pxhHubCap->GetLiveHistogram2Info(ppHistogram);
}

int DD_HubCap::GetGrayValue(int x,int y,DWORD &dwGray)
{
	DKQ_SECT;
	return m_pxhHubCap->GetGrayValue(x,y,dwGray);
}
int DD_HubCap::GetGray2Value(int x,int y,DWORD &dwGray)
{
	DKQ_SECT;
	return m_pxhHubCap->GetGray2Value(x,y,dwGray);
}


int DD_HubCap::GetImageData(zkImgBitInfo **ppImgBitInfo)
{
	DKQ_SECT;
	return m_pxhHubCap->GetImageData(ppImgBitInfo);
}
int DD_HubCap::GetImageInfo(zkImgBitInfo **ppImgBitInfo)
{
	DKQ_SECT;
	return m_pxhHubCap->GetImageInfo(ppImgBitInfo);
}




int DD_HubCap::SelectBadPixelFile(char *pFileName)
{
	DKQ_SECT;
	return m_pxhHubCap->SelectBadPixelFile(pFileName);
}

int DD_HubCap::SelectReviseFile(char *pFileName,int nCreateRevise)
{
	DKQ_SECT;
	return m_pxhHubCap->SelectReviseFile(pFileName,nCreateRevise);
}

int DD_HubCap::CreateRevise(void *pVoid)
{
	DKQ_SECT;
	return m_pxhHubCap->CreateRevise(pVoid);
}

int DD_HubCap::SetReviseGrade(int nGrade)
{
	DKQ_SECT;
	return m_pxhHubCap->SetReviseGrade(nGrade);
}

int DD_HubCap::SaveReviseFile(char *pFileName)
{
	DKQ_SECT;
	return m_pxhHubCap->SaveReviseFile(pFileName);
}

int DD_HubCap::CreateBadPixelRevise(void *pVoid)
{
	DKQ_SECT;
	return m_pxhHubCap->CreateBadPixelRevise(pVoid);
}

int DD_HubCap::SetBadPixelReviseGrade(int nGrade)
{
	DKQ_SECT;
	return m_pxhHubCap->SetBadPixelReviseGrade(nGrade);
}

int DD_HubCap::SaveBadPixelReviseFile(char *pFileName)
{
	DKQ_SECT;
	return m_pxhHubCap->SaveBadPixelReviseFile(pFileName);
}

int DD_HubCap::GetBadPixelValue(int x,int y,DWORD &dwValue)
{
	DKQ_SECT;
	return m_pxhHubCap->GetBadPixelValue(x,y,dwValue);
}

int DD_HubCap::SetBadPixelValue(int x,int y,DWORD dwValue)
{
	DKQ_SECT;
	return m_pxhHubCap->SetBadPixelValue(x,y,dwValue);
}


int DD_HubCap::SetRecordParam(void *pVoid )
{
	DKQ_SECT;
	return m_pxhHubCap->SetRecordParam(pVoid);
}
int DD_HubCap::StartRecord(char *pFileName)
{
	DKQ_SECT;
	return m_pxhHubCap->StartRecord( pFileName );
}
int DD_HubCap::StopRecord()
{
	DKQ_SECT;
	return m_pxhHubCap->StopRecord();
}